#!/usr/bin/python
# -----------------------------------------------------------------------------
# Copyright (c) 2011, MIPS Technologies, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#   * Redistributions of source code must retain the above copyright
#     notice, this list of conditions, and the following disclaimer.
#   * Redistributions in binary form must reproduce the above copyright
#     notice, this list of conditions, and the following disclaimer in the
#     documentation and/or other materials provided with the distribution.
#   * Neither the name of MIPS Technologies, Inc. nor the
#     names of its contributors may be used to endorse or promote products
#     derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MIPS TECHNOLOGIES, INC. BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES, LOSS OF USE, DATA, OR PROFITS, OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
'''
Created on May 17, 2011

@author: rkotler
'''

import gcc_generic
import DriverConfig
import Utils
import sys

#from gcc_generic import process_args, do_compile
#from gcc_generic import c_compiler_fe, cxx_compiler_fe
#from gcc_generic import print_multi_lib, print_multi_directory

import subprocess

#cfg = DriverConfig.Config(DriverConfig.Config.MODE_GCC)
#cfg.read()

#"-std=c99",

gcc_generic.print_multi_lib  = r""".;
el;@EL
mips32;@mips32
soft-float;@msoft-float
soft-float/mips32;@msoft-float@mips32
el/soft-float;@EL@msoft-float
el/mips32;@EL@mips32
el/soft-float/mips32;@EL@msoft-float@mips32
"""
gcc_generic.print_multi_directory = r"""."""

gccgen = gcc_generic.GCCGeneric(DriverConfig.Config.MODE_GCC)
ret_code = gccgen.buildall()
sys.exit(ret_code)
